<%--
  Created by IntelliJ IDEA.
  User: taohj
  Date: 2014/6/29
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="menu" value="none" scope="request"></c:set>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
        + request.getServerName() + ":" + request.getServerPort()
        + path + "/";
%>
<c:set var="dashboardMenuTag" value="myApp" scope="request"></c:set>

<!Doctype html>
<html>
<head>
    <base href="<%=basePath%>">
    <title>政府数据开放平台</title>
    <jsp:include page="../../commons/include.jsp"/>

    <link href="/resources/css/lib.css" rel="stylesheet">


    <style>
        li[type=theme] {
            cursor: pointer;
            color: rgb(58, 123, 200);
            list-style: none;
            line-height: 30px;
        }
    </style>


    <script>
    $(function () {
    $(".table tbody tr").each(function (index) {
        $(this).find(":last-child :first-child").on('click', function () {
            var appid = $(this).attr('appid');
            location.href = '/front/my/favorites/modifyV?id=' + appid;
        });

        $(this).find(":last-child :last-child").on('click', function () {
            if (confirm("确定要删除吗？")) {
                var appid = $(this).attr('appid');
                location.href = '/front/my/favorites/remove?id=' + appid;
            }
        });
    });
    });
    </script>


</head>
<body>


<jsp:include page="../../commons/top.jsp"/>

<div class="main">


    <jsp:include page="../../commons/dashboardMenu.jsp"/>

    <div style="margin-top: 0px">

      


       

            <div style="height: 80px; width: 100%;padding: 20px 0px 20px 20px;">
                <input type="button" class="btn btn-primary" onclick="location.href='/front/my/favorites/createV'" value="新 增"/>
            </div>

            <form action="/front/my/favorites/list" method="post" style="padding-left: 30px;">
              
                <input type="hidden" name="page" value="1">
                <input type="hidden" name="size" value="20">

                <div style="padding: 20px 0px">

                    <input type="text" name="name" class="form-control"
                           style="width: 600px;  display: inline; margin: 0px" value="${requestScope.favorites.name}">
                    <input type="submit" style="display: inline; margin: 0px 0px 0px -9px" value=" 搜 索"/>
                </div>


                <div style="height: 80px; width: 100%;">
                    <div style="width: 350px; height: 100%;float: left; font-size: 24px; font-weight: bold;">
                        找到${requestScope.result.pageResult.total}个应用
                    </div>
                    <div style="width: 300px; height: 100%;float: left;">
                        <label style="font-size: 14px; font-weight: bold;">排序:</label>
                        <select name="order" class="form-control" style="display: inline;width: 120px">
                            <option value="asc">名称升序</option>
                            <option value="desc"
                                    <c:if test="${requestScope.order=='desc'}">selected="selected" </c:if>  >名称降序
                            </option>
                        </select>
                    </div>
                </div>
            </form>


            <div style="margin-top: 10px;padding-left: 16px;min-height: 400px">
                <table class="table">
                    <thead>
                    <tr style="font-size: 14px; font-weight: bold;">
                        <td width="50">序号</td>
                        <td width="150">编号</td>
                        <td width="100">名称</td>
                        <td width="100">简介</td>
                        <td width="100">创建时间</td>
                        <td width="100">创建人</td>
                   
                        <td width="100">收藏类型</td>
                        <td width="100">操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${requestScope.result.pageResult.rows}" var="f" varStatus="index">
                        <tr>
                            <td>${index.count}</td>
							      <td>${f.id}</td>
                            <td><a href="/front/my/favorites/detailList?fid=${f.id}">${f.name}</a> </td>
                            <td>${f.description}</td>
                           <td><fmt:formatDate value="${f.createTime}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                           <td>${f.creater.username}</td>
						     <td>${f.type.name}</td>
               
                      <td><a href="javascript:void(0);" appid="${f.id}">更新</a>&nbsp;<a
                                    href="javascript:void(0);" appid="${f.id}">删除</a>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>


            <div>
                <ul class="pagination" style="margin: 20px 30px;">
                    <li page="${requestScope.result.pageResult.startPage-1}">&laquo;</li>

                    <c:forEach begin="${requestScope.result.pageResult.startPage}"
                               end="${requestScope.result.pageResult.endPage}" var="index">
                        <li page="${index}" <c:if
                                test="${index==requestScope.result.pageResult.page}"> class="active" </c:if> >${index}
                        </li>
                    </c:forEach>

                    <li page="${requestScope.result.pageResult.endPage+1}">&raquo;</li>
                </ul>

            </div>


      


    </div>


</div>


<jsp:include page="../../commons/buttom.jsp"/>
</body>
</html>
